<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
             
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html>
  <head>
    <base href="<%=basePath%>"> 
    
    <title>My JSP 'index.jsp' starting page</title>
     <link rel="stylesheet" type="text/css" href="css/maintable.css" ></link>
    <link rel="stylesheet" type="text/css" href="css/edittable.css"  ></link>  
		<link rel="stylesheet" type="text/css" href="css/validate.css"  ></link>  
		<script type="text/javascript"  src="js/jquery-1.8.0.js"></script>
    <script>
    function  lockBigCate(id){
			if(confirm('确定要删除吗')){
			window.location.href="CateServlet.do?flag=delbigcate&id="+id;
		}
	}
    function  lockSmallCate(id){
		if(confirm('确定要删除吗')){
		window.location.href="CateServlet.do?flag=delsmallcate&id="+id;
	}
}
    
    </script>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	
	
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
  	<div class ="div_title">
						<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>商品列表</span></div>
						<div class="div_titleoper">
						 </div>
				 </div>
			
				 <form action="CateServlet.do?flag=manage"  name="form1" method="post">
				 <table class="main_table" >
				       <tr>
				 			<th width="15%"></th><th width="35%">一级分类</th> <th  width="15%"></th>	<th width="35%">二级分类</th>	
				 		</tr>
				 		
				 				<c:forEach var="cate" items="${cateList }">
				 		<tr>
				 				<td>${cate.cateName }</td>
				 				<td>
				 				<a href="goods/bigcate_modify.jsp?id=${cate.id }&note=${cate.des}&bigcateName=${cate.cateName}">修改</a> | 
					 			<a href="javascript:lockBigCate(${cate.id })">删除</a> 
				 				</td>
				 				<td>
				 				<c:forEach var="cate2" items="${cate.cateList }">
				 					
				 					${cate2.cateName }<br>
				 					
				 					
				 				</c:forEach>
				 				</td>
				 				<td>
				 				<c:forEach var="cate2" items="${cate.cateList }">
				 					<a href="goods/smallcate_modify.jsp?id=${cate2.id }&note=${cate2.des}&smallcateName=${cate2.cateName}&bigcateId=${cate.id}">修改</a> | 
					 				<a href="javascript:lockSmallCate(${cate2.id })">删除</a> <br>
				 				</c:forEach>
				 				</td>
				 				
				 		</tr>
				 		</c:forEach>
				</table>
				</form>
				<script>
				var msg='${msg}';
				if(msg!=''){
					alert(msg);
				}
				</script>
  </body>
</html>